import pymysql

# Open database connection


# prepare a cursor object using cursor() method
sql_02 = "insert into products values ('4','滑轮','导轮','200*100*50','6')"
sql_03 = "insert into products values ('3','滑块','固定块','200*100*50','6')"
sql_01 = 'delete from products where number = "1"'


def mysql_insert(get_number,get_type,get_name,get_size,get_quantity):
    db = pymysql.connect(host='localhost', user="root", password="123456", database="cangku")
    cursor = db.cursor()
    cursor.execute("insert into products(number,type,name,size,quantity)values('%s','%s','%s','%s','%s')" % (get_number,get_type,get_name,get_size,get_quantity))
    db.commit()
    db.close()


# mysql_insert(get_number='5',get_type='导绳器',get_name='cd导绳器',get_size='300*250*50',get_quantity='5')